#include "msg.h"


/** Autuor : zhaoshun
  * Time   : 2017/11/12 22:20
  * Email  : tmby1314@163.com */

int main_msg(int argc, char **argv) {
    struct msgtype buf;
    int qid, pid;
    qid = msgget(MSGKEY, IPC_CREAT | 0666);
    buf.mtype = 1;
    buf.text = pid = getpid();

    msgsnd(qid, &buf, sizeof(buf.text), IPC_NOWAIT | 04000);
    msgrcv(qid, &buf, 512, pid, MSG_NOERROR);
    printf("Request received a massages from server, type is : %d\n", buf.mtype);
}


